<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude #-}</span><span>
</span><span id="line-2"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-4"></span><span class="hs-comment">-- Module      :  GHC.Event.TimeOut</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- Copyright   :  (c) Tamar Christina 2018</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-7"></span><span class="hs-comment">--</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Portability :  non-portable</span><span>
</span><span id="line-11"></span><span class="hs-comment">--</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Common Timer definitions shared between WinIO and RIO.</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-15"></span><span>
</span><span id="line-16"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Event.TimeOut</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.html"><span class="hs-identifier">GHC.IO</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Event.PSQ.html"><span class="hs-identifier">GHC.Event.PSQ</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Q</span></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Event.Unique.html"><span class="hs-identifier">GHC.Event.Unique</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Event.Unique.html#Unique"><span class="hs-identifier">Unique</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span class="hs-comment">-- | A priority search queue, with timeouts as priorities.</span><span>
</span><span id="line-25"></span><span class="hs-keyword">type</span><span> </span><span id="TimeoutQueue"><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutQueue"><span class="hs-identifier hs-var">TimeoutQueue</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Event.PSQ.html#PSQ"><span class="hs-identifier hs-type">Q.PSQ</span></a></span><span> </span><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutCallback"><span class="hs-identifier hs-type">TimeoutCallback</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- Warning: since the 'TimeoutCallback' is called from the I/O manager, it must</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- not throw an exception or block for a long period of time.  In particular,</span><span>
</span><span id="line-30"></span><span class="hs-comment">-- be wary of 'Control.Exception.throwTo' and 'Control.Concurrent.killThread':</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- if the target thread is making a foreign call, these functions will block</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- until the call completes.</span><span>
</span><span id="line-33"></span><span class="hs-keyword">type</span><span> </span><span id="TimeoutCallback"><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutCallback"><span class="hs-identifier hs-var">TimeoutCallback</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- | An edit to apply to a 'TimeoutQueue'.</span><span>
</span><span id="line-36"></span><span class="hs-keyword">type</span><span> </span><span id="TimeoutEdit"><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutEdit"><span class="hs-identifier hs-var">TimeoutEdit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutQueue"><span class="hs-identifier hs-type">TimeoutQueue</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutQueue"><span class="hs-identifier hs-type">TimeoutQueue</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-comment">-- | A timeout registration cookie.</span><span>
</span><span id="line-39"></span><span class="hs-keyword">newtype</span><span> </span><span id="TimeoutKey"><span class="annot"><a href="GHC.Event.TimeOut.html#TimeoutKey"><span class="hs-identifier hs-var">TimeoutKey</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TK"><span class="annot"><a href="GHC.Event.TimeOut.html#TK"><span class="hs-identifier hs-var">TK</span></a></span></span><span> </span><span class="annot"><a href="GHC.Event.Unique.html#Unique"><span class="hs-identifier hs-type">Unique</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679551711"><span id="local-6989586621679551716"><span class="annot"><span class="annottext">TimeoutKey -&gt; TimeoutKey -&gt; Bool
(TimeoutKey -&gt; TimeoutKey -&gt; Bool)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Bool) -&gt; Eq TimeoutKey
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c/= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
== :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c== :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679551678"><span id="local-6989586621679551682"><span id="local-6989586621679551686"><span id="local-6989586621679551690"><span id="local-6989586621679551694"><span id="local-6989586621679551698"><span id="local-6989586621679551703"><span class="annot"><span class="annottext">Eq TimeoutKey
Eq TimeoutKey
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Ordering)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Bool)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Bool)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Bool)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; Bool)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey)
-&gt; (TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey)
-&gt; Ord TimeoutKey
TimeoutKey -&gt; TimeoutKey -&gt; Bool
TimeoutKey -&gt; TimeoutKey -&gt; Ordering
TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey
forall a.
Eq a
-&gt; (a -&gt; a -&gt; Ordering)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; Bool)
-&gt; (a -&gt; a -&gt; a)
-&gt; (a -&gt; a -&gt; a)
-&gt; Ord a
min :: TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey
$cmin :: TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey
max :: TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey
$cmax :: TimeoutKey -&gt; TimeoutKey -&gt; TimeoutKey
&gt;= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c&gt;= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
&gt; :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c&gt; :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
&lt;= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c&lt;= :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
&lt; :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
$c&lt; :: TimeoutKey -&gt; TimeoutKey -&gt; Bool
compare :: TimeoutKey -&gt; TimeoutKey -&gt; Ordering
$ccompare :: TimeoutKey -&gt; TimeoutKey -&gt; Ordering
</span><a href="../../ghc-prim/src/GHC.Classes.html#Ord"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Ord</span></a></span></span></span></span></span></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-41"></span></pre></body></html>